package com.towker.frame.service.report;

import java.util.Map;

import org.springframework.stereotype.Service;


import com.towker.core.db.BaseService;
import com.towker.core.db.EntityDao;
import com.towker.core.page.PageModel;
import com.towker.core.page.PageRequest;
import com.towker.frame.dao.report.WarehouseDao;
import com.towker.frame.model.report.Warehouse;

@Service
public class WarehouseService extends BaseService<Warehouse,Long> {
	
	private WarehouseDao dao;
	
	public void setWarehouseDao(WarehouseDao dao)
	{
		this.dao = dao;
	}
	
	@SuppressWarnings("unchecked")
	@Override
	protected EntityDao getEntityDao()
	{
		return this.dao;
	}
	
	
	/**
	 * 得到分页模型
	 * @param currentPage
	 * @param pageSize
	 * @param map
	 * @return
	 */
	public PageModel getPage(int currentPage, int pageSize, Map map,String namespaceId)
	{
		PageRequest request = new PageRequest();
		request.setFilters(map);
		request.setCurrentPage(currentPage);
		request.setPageSize(pageSize);
		PageModel page = dao.getPage(request,namespaceId);
		return page;
	}

}
